package top.yaofengqiao.springcloudsimple.system.biz.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import top.yaofengqiao.dynamicthreadpool.core.thread.MonitoringThreadPoolExecutor;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author yfq
 * @date 16:23
 * @description
 */
@Configurable
public class ThreadPoolConfig {
    @Bean
    public ThreadPoolExecutor operatorLogThreadPoolExecutor() {
        return new MonitoringThreadPoolExecutor(2,
                2,
                0,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(1000));
    }
}
